#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    // 验证两次输入的密码是否一致

    ui->lineEdit->setEchoMode(QLineEdit::Password);
    ui->lineEdit_2->setEchoMode(QLineEdit::Password);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    QString password1 = ui->lineEdit->text();
    QString password2 = ui->lineEdit_2->text();
    if (password1.isEmpty() || password2.isEmpty()) {
        ui->label_3->setText("密码不能为空!!!");
    } else if (password1 == password2) {
        ui->label_3->setText("两次输入的密码一致!!");
    } else {
        ui->label_3->setText("两次输入的密码不一致!!");
    }
}
